const express = require('express')
// 方法引入
const { login, update } = require('../../controllers/admin/userControllers')

let router = express.Router()

// 头像文件上传后获取 by中间件
const multer = require('multer')
// 目标文件夹
const upload = multer({ dest: 'public/avataruploads/' })

// 用户登录
router.post('/admin/userRouter/login', login)

//用户信息更新
//中间件作用_ 找到file文件放在目标文件夹下
router.post('/admin/userRouter/update', upload.single('file'), update)

router.get('/admin/userRouter/try', (req, res) => {
  res.send('ok')
})

module.exports = router
